package test.my.com.myapplicationtest.MyRadioGroup;

import android.app.Activity;
import android.os.Bundle;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.Toast;

import com.umeng.update.UmengUpdateAgent;

import test.my.com.myapplicationtest.R;

/**
 * Created by ThinkPad on 2015/12/18.
 */
public class MyRadioActivity extends Activity {

    private LinearLayout iv_ll;
    private ImageView left_iv;
    private ImageView right_iv;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.my_radio_layout_aty);

        iv_ll = (LinearLayout) findViewById(R.id.iv_ll);
        left_iv = (ImageView) findViewById(R.id.left_iv);

        UmengUpdateAgent.update(this);
        right_iv = (ImageView) findViewById(R.id.right_iv);
        iv_ll.setOnClickListener(new MyRadioClickListener(left_iv,right_iv,this) {
            @Override
            public void setOnRadioCheckedListener(int view_id, boolean isChecked) {
                switch (view_id){
                    case R.id.left_iv:
                        if(isChecked){
                            String a = null;
                            if(a.length() == 0){

                            }
                            Toast.makeText(MyRadioActivity.this,"left_iv 左边== "+isChecked,Toast.LENGTH_LONG).show();
                        }else{
                            Toast.makeText(MyRadioActivity.this,"left_iv 左边== "+isChecked,Toast.LENGTH_LONG).show();
                        }
                        break;
                    case R.id.right_iv:
                        if(isChecked){
                            Toast.makeText(MyRadioActivity.this,"right_iv 右边== "+isChecked,Toast.LENGTH_LONG).show();
                        }else{
                            Toast.makeText(MyRadioActivity.this,"right_iv 右边== "+isChecked,Toast.LENGTH_LONG).show();
                        }
                        break;
                }
            }
        });
    }
}
